home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / include / time.h < prev    next >
C/C++ Source or Header  |  1996-01-30  |  3KB  |  86 lines

  1. /*
  2.  * Copyright (c) 1989 The Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms are permitted provided
  6.  * that: (1) source distributions retain this entire copyright notice and
  7.  * comment, and (2) distributions including binaries display the following
  8.  * acknowledgement:  ``This product includes software developed by the
  9.  * University of California, Berkeley and its contributors'' in the
  10.  * documentation or other materials provided with the distribution and in
  11.  * all advertising materials mentioning features or use of this software.
  12.  * Neither the name of the University nor the names of its contributors may
  13.  * be used to endorse or promote products derived from this software without
  14.  * specific prior written permission.
  15.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  16.  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  17.  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  18.  *
  19.  *      @(#)time.h      5.6 (Berkeley) 6/23/90
  20.  */
  21.  
  22. #ifndef _TIME_H_
  23. #define _TIME_H_
  24.  
  25. #include <sys/types.h>
  26.  
  27. #define CLOCKS_PER_SEC 1000000
  28.  
  29. #ifndef NULL
  30. #define NULL    0
  31. #endif
  32.  
  33. #ifdef  _CLOCK_T_
  34. typedef _CLOCK_T_       clock_t;
  35. #undef  _CLOCK_T_
  36. #else
  37. #define clock_t long
  38. #endif
  39.  
  40. #ifdef  _TIME_T_
  41. typedef _TIME_T_        time_t;
  42. #undef  _TIME_T_
  43. #endif
  44.  
  45. #ifndef _STDDEF_H
  46. #ifndef _stddef_h
  47. #ifdef  _SIZE_T_
  48. typedef _SIZE_T_        size_t;
  49. #undef  _SIZE_T_
  50. #endif
  51. #endif
  52. #endif
  53.  
  54. struct tm {
  55.         int     tm_sec;         /* seconds after the minute [0-60] */
  56.         int     tm_min;         /* minutes after the hour [0-59] */
  57.         int     tm_hour;        /* hours since midnight [0-23] */
  58.         int     tm_mday;        /* day of the month [1-31] */
  59.         int     tm_mon;         /* months since January [0-11] */
  60.         int     tm_year;        /* years since 1900 */
  61.         int     tm_wday;        /* days since Sunday [0-6] */
  62.         int     tm_yday;        /* days since January 1 [0-365] */
  63.         int     tm_isdst;       /* Daylight Savings Time flag */
  64.         long    tm_gmtoff;      /* offset from CUT in seconds */
  65.         char    *tm_zone;       /* timezone abbreviation */
  66. };
  67.  
  68. #ifdef __cplusplus
  69. extern "C" {
  70. #endif
  71. extern struct tm *gmtime(const time_t *);
  72. extern struct tm *localtime(const time_t *);
  73. extern time_t mktime(const struct tm *);
  74. extern unsigned long time(unsigned long *);
  75. extern double difftime(const time_t, const time_t);
  76. extern char *asctime(const struct tm *);
  77. extern char *ctime(const time_t *);
  78. /* extern char *timezone(int , int); */
  79. extern void tzset(void);
  80. extern void tzsetwall(void);
  81. #ifdef __cplusplus
  82. }
  83. #endif
  84.  
  85. #endif
  86.